package com.crealth.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Calendar;

import com.alibaba.fastjson.JSONObject;
import com.crealth.ConstantDefine;
import com.crealth.db.CompanyDb;
import com.crealth.memcached.CompanyCached;

public class UserModel implements Serializable {
	private static final long serialVersionUID = 52486021L;

	private int id;
	private String loginName;
	private String loginPwd;
	private String userName;
	private int companyID;
	private int position;  //  职位
	private String mobiphone;
	private String QQ;
	private String weixin;
	private int online;
	private int leaderID;
	private String sipServerIP;
	private String sipAccount;
	private String sipPwd;
	private String incomingServerIP;
	private String incomingSipAct;
	private String incomingSipPwd;
	private int fixedSip;
	
	private String staffID;  //  工号
	private int teamID;
	private int sex;
	private String identity;
	private String nativePlace;  //  籍贯
	private String household;  //  户籍
	private int basicSalary;  //  底薪
	private Timestamp entryTime;  // 入职日期
	private String houseAddress;  // 住址
	private String graduateSchool;  // 毕业院校
	private String education;  // 学历
	private String major;  // 专业
	private String salaryCard;  // 工资卡号
	private String openingBank;  //  开户行
	private String shebaoNum;  // 社保号
	private String emergencyContact;  // 紧急联系人
	private String contactRelation;  // 紧急联系人关系
	private String contactPhone;  // 紧急联系人 手机号
	private int staffStatus;  // 员工状态
	private Timestamp positiveTime;  // 转正日期
	private Timestamp leaveOfficeTime;  // 离职日期
	private String hobbies;  //  兴趣爱好
	private String preCompany;  // 上家公司
	private int MOB;
	private String macAddr;  // MAC 地址
	private String preLoginMac;  // 上次登录的 MAC 地址
	private int forbidLogin;  //  禁止 登录
	
	private String entryFile;  //  入职文件
	private String pictureFile;  //  照片
	private String identityFile;  //  身份证
	private String bankFile;  //  银行卡
	private String otherFile;  //  其他文件
	private String entryFileUrl;  //  入职文件
	private String pictureFileUrl;  //  照片
	private String identityFileUrl;  //  身份证
	private String bankFileUrl;  //  银行卡
	private String otherFileUrl;  //  其他文件
	private String memo;  // 备注
	private String referrer;  // 推荐人
	private String groupMgr;  // 小组
	private String shortNum;  //  短号
	
	public UserModel() {
		id = 0;
		companyID = 0;
		position = 0;
		online = 0;
		leaderID = 0;
		loginName = "";
		loginPwd = "";
		userName = "";
		mobiphone = "";
		QQ = "";
		weixin = "";
		sipServerIP = "";
		sipAccount = "";
		sipPwd = "";
		incomingServerIP = "";
		incomingSipAct = "";
		incomingSipPwd = "";
		
		staffID = "";  //  工号
		teamID = 0;
		sex = -1;
		identity = "";
		nativePlace = "";  //  籍贯
		household = "";  //  户籍
		basicSalary = 0;  //  底薪
		entryTime = null;  // 入职日期
		houseAddress = "";  // 住址
		graduateSchool = "";  // 毕业院校
		education = "";  // 学历
		major = "";  // 专业
		salaryCard = "";  // 工资卡号
		openingBank = "";
		shebaoNum = "";  // 社保号
		emergencyContact = "";  // 紧急联系人
		contactRelation = "";  // 紧急联系人关系
		contactPhone = "";  // 紧急联系人 手机号
		staffStatus = 0;  // 员工状态
		positiveTime = null;  // 转正日期
		leaveOfficeTime = null;
		hobbies = "";
		preCompany = "";
		MOB = 0;
		macAddr = "";
		
		entryFile = "";
		pictureFile = "";
		identityFile = "";
		bankFile = "";
		otherFile = "";
		entryFileUrl = "";
		pictureFileUrl = "";
		identityFileUrl = "";
		bankFileUrl = "";
		otherFileUrl = "";
		memo = "";
		referrer = "";
		groupMgr = "";
		shortNum = "";
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getLoginName() {
		return loginName;
	}
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	public String getLoginPwd() {
		return loginPwd;
	}
	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public int getCompanyID() {
		return companyID;
	}
	public void setCompanyID(int companyID) {
		this.companyID = companyID;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public int getPosition() {
		return position;
	}
	public void setPosition(int position) {
		this.position = position;
	}
	public String getMobiphone() {
		return mobiphone;
	}
	public void setMobiphone(String mobiphone) {
		this.mobiphone = mobiphone;
	}
	public String getQQ() {
		return QQ;
	}
	public void setQQ(String qQ) {
		QQ = qQ;
	}
	public String getWeixin() {
		return weixin;
	}
	public void setWeixin(String weixin) {
		this.weixin = weixin;
	}
	public int getOnline() {
		return online;
	}
	public void setOnline(int online) {
		this.online = online;
	}	
	public int getLeaderID() {
		return leaderID;
	}
	public void setLeaderID(int leaderID) {
		this.leaderID = leaderID;
	}	
	public String getStaffID() {
		return staffID;
	}
	public void setStaffID(String staffID) {
		this.staffID = staffID;
	}
	public int getTeamID() {
		return teamID;
	}
	public void setTeamID(int teamID) {
		this.teamID = teamID;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}	
	public String getHobbies() {
		return hobbies;
	}
	public void setHobbies(String hobbies) {
		this.hobbies = hobbies;
	}
	public String getPreCompany() {
		return preCompany;
	}
	public void setPreCompany(String preCompany) {
		this.preCompany = preCompany;
	}
	public String getIdentity() {
		return identity;
	}
	public void setIdentity(String identity) {
		this.identity = identity;
	}
	public String getNativePlace() {
		return nativePlace;
	}
	public void setNativePlace(String nativePlace) {
		this.nativePlace = nativePlace;
	}
	public String getHousehold() {
		return household;
	}
	public void setHousehold(String household) {
		this.household = household;
	}
	public int getBasicSalary() {
		return basicSalary;
	}
	public void setBasicSalary(int basicSalary) {
		this.basicSalary = basicSalary;
	}

	public Timestamp getEntryTime() {
		return entryTime;
	}
	public void setEntryTime(Timestamp entryTime) {
		this.entryTime = entryTime;
	}
	public String getHouseAddress() {
		return houseAddress;
	}
	public void setHouseAddress(String houseAddress) {
		this.houseAddress = houseAddress;
	}
	public String getGraduateSchool() {
		return graduateSchool;
	}
	public void setGraduateSchool(String graduateSchool) {
		this.graduateSchool = graduateSchool;
	}

	public String getEducation() {
		return education;
	}
	public void setEducation(String education) {
		this.education = education;
	}
	public String getMajor() {
		return major;
	}
	public void setMajor(String major) {
		this.major = major;
	}
	public String getSalaryCard() {
		return salaryCard;
	}
	public void setSalaryCard(String salaryCard) {
		this.salaryCard = salaryCard;
	}	
	public String getOpeningBank() {
		return openingBank;
	}
	public void setOpeningBank(String openingBank) {
		this.openingBank = openingBank;
	}
	public String getShebaoNum() {
		return shebaoNum;
	}
	public void setShebaoNum(String shebaoNum) {
		this.shebaoNum = shebaoNum;
	}
	public String getEmergencyContact() {
		return emergencyContact;
	}
	public void setEmergencyContact(String emergencyContact) {
		this.emergencyContact = emergencyContact;
	}
	public String getContactRelation() {
		return contactRelation;
	}
	public void setContactRelation(String contactRelation) {
		this.contactRelation = contactRelation;
	}
	public String getContactPhone() {
		return contactPhone;
	}
	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}
	public int getStaffStatus() {
		return staffStatus;
	}
	public void setStaffStatus(int staffStatus) {
		this.staffStatus = staffStatus;
	}
	public Timestamp getPositiveTime() {
		return positiveTime;
	}
	public void setPositiveTime(Timestamp positiveTime) {
		this.positiveTime = positiveTime;
	}
	public Timestamp getLeaveOfficeTime() {
		return leaveOfficeTime;
	}
	public void setLeaveOfficeTime(Timestamp leaveOfficeTime) {
		this.leaveOfficeTime = leaveOfficeTime;
	}
	public String getSipAccount() {
		return sipAccount;
	}
	public void setSipAccount(String sipAccount) {
		this.sipAccount = sipAccount;
	}
	public String getSipPwd() {
		return sipPwd;
	}
	public void setSipPwd(String sipPwd) {
		this.sipPwd = sipPwd;
	}
	public String getIncomingSipAct() {
		return incomingSipAct;
	}
	public void setIncomingSipAct(String incomingSipAct) {
		this.incomingSipAct = incomingSipAct;
	}
	public String getIncomingSipPwd() {
		return incomingSipPwd;
	}
	public void setIncomingSipPwd(String incomingSipPwd) {
		this.incomingSipPwd = incomingSipPwd;
	}	
	public int getMOB() {
		return MOB;
	}
	public void setMOB(int mOB) {
		MOB = mOB;
	}	
	public int getFixedSip() {
		return fixedSip;
	}
	public void setFixedSip(int fixedSip) {
		this.fixedSip = fixedSip;
	}
	public String getSipServerIP() {
		return sipServerIP;
	}
	public void setSipServerIP(String sipServerIP) {
		this.sipServerIP = sipServerIP;
	}
	public String getIncomingServerIP() {
		return incomingServerIP;
	}
	public void setIncomingServerIP(String incomingServerIP) {
		this.incomingServerIP = incomingServerIP;
	}	
	public String getMacAddr() {
		return macAddr;
	}
	public void setMacAddr(String macAddr) {
		this.macAddr = macAddr;
	}	
	public String getPreLoginMac() {
		return preLoginMac;
	}
	public void setPreLoginMac(String preLoginMac) {
		this.preLoginMac = preLoginMac;
	}	
	public int getForbidLogin() {
		return forbidLogin;
	}
	public void setForbidLogin(int forbidLogin) {
		this.forbidLogin = forbidLogin;
	}	
	public String getEntryFile() {
		return entryFile;
	}
	public void setEntryFile(String entryFile) {
		this.entryFile = entryFile;
	}
	public String getPictureFile() {
		return pictureFile;
	}
	public void setPictureFile(String pictureFile) {
		this.pictureFile = pictureFile;
	}
	public String getIdentityFile() {
		return identityFile;
	}
	public void setIdentityFile(String identityFile) {
		this.identityFile = identityFile;
	}
	public String getBankFile() {
		return bankFile;
	}
	public void setBankFile(String bankFile) {
		this.bankFile = bankFile;
	}
	public String getOtherFile() {
		return otherFile;
	}
	public void setOtherFile(String otherFile) {
		this.otherFile = otherFile;
	}	
	public String getEntryFileUrl() {
		return entryFileUrl;
	}
	public void setEntryFileUrl(String entryFileUrl) {
		this.entryFileUrl = entryFileUrl;
	}
	public String getPictureFileUrl() {
		return pictureFileUrl;
	}
	public void setPictureFileUrl(String pictureFileUrl) {
		this.pictureFileUrl = pictureFileUrl;
	}
	public String getIdentityFileUrl() {
		return identityFileUrl;
	}
	public void setIdentityFileUrl(String identityFileUrl) {
		this.identityFileUrl = identityFileUrl;
	}
	public String getBankFileUrl() {
		return bankFileUrl;
	}
	public void setBankFileUrl(String bankFileUrl) {
		this.bankFileUrl = bankFileUrl;
	}
	public String getOtherFileUrl() {
		return otherFileUrl;
	}
	public void setOtherFileUrl(String otherFileUrl) {
		this.otherFileUrl = otherFileUrl;
	}	
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}	
	public String getReferrer() {
		return referrer;
	}
	public void setReferrer(String referrer) {
		this.referrer = referrer;
	}	
	public String getGroupMgr() {
		return groupMgr;
	}
	public void setGroupMgr(String groupMgr) {
		this.groupMgr = groupMgr;
	}	
	public String getShortNum() {
		return shortNum;
	}
	public void setShortNum(String shortNum) {
		this.shortNum = shortNum;
	}

	public JSONObject sipInfoToJson(JSONObject resJson) {
		if (resJson == null) {
			resJson = new JSONObject();
		}
		if (sipAccount.length() > 0) {
			resJson.put("sipAct", sipAccount);
			if (sipPwd.length() > 0) {
				resJson.put("sipPwd", sipPwd);
			}
		}		
		if (incomingSipAct != null && incomingSipAct.length() > 0) {
			resJson.put("incomingSipAct", incomingSipAct);
			if (incomingSipPwd != null && incomingSipPwd.length() > 0) {
				resJson.put("incomingSipPwd", incomingSipPwd);
			}
		}
		if (sipServerIP != null && sipServerIP.length() > 0) {
			resJson.put("sipServerIP", sipServerIP);
		}
		if (incomingServerIP != null && incomingServerIP.length() > 0) {
			resJson.put("incomingServerIP", incomingServerIP);
		}
		
		return resJson;
	}

	public JSONObject toJSONObject(JSONObject resJson) {
		if (resJson == null) {
			resJson = new JSONObject();
		}
		resJson.put("ID", id);
		resJson.put("LoginName", loginName);
		resJson.put("UserName", userName);
		resJson.put("CompanyID", companyID);
		resJson.put("position", position);
		resJson.put("mobiphone", mobiphone);
		resJson.put("QQ", QQ);
		resJson.put("weixin", weixin);
		resJson.put("leader", this.leaderID);
		resJson.put("MOB", MOB);
		if (sipAccount.length() > 0) {
			resJson.put("sipAct", sipAccount);
			if (sipPwd.length() > 0) {
				resJson.put("sipPwd", sipPwd);
			}
		}		
		if (incomingSipAct != null && incomingSipAct.length() > 0) {
			resJson.put("incomingSipAct", incomingSipAct);
			if (incomingSipPwd != null && incomingSipPwd.length() > 0) {
				resJson.put("incomingSipPwd", incomingSipPwd);
			}
		}		
		
		if (staffID.length() > 0) {
			resJson.put("staffID", staffID);
		}
		if (teamID > 0) {
			resJson.put("teamID", teamID);
		}
		if (sex > 0) {
			resJson.put("sex", sex);
		}
		if (identity.length() > 0) {
			resJson.put("identity", identity);
		}
		if (nativePlace.length() > 0 ) {
			resJson.put("nativePlace", nativePlace);
		}
		if (household.length() > 0) {
			resJson.put("household", household);
		}
		if (basicSalary > 0) {
			resJson.put("basicSalary", basicSalary);
		}
		if (entryTime != null) {
			resJson.put("entryTime", entryTime.getTime()/1000);
		}
		if (houseAddress.length() > 0) {
			resJson.put("houseAddress", houseAddress);
		}
		if (graduateSchool.length() > 0) {
			resJson.put("graduateSchool", graduateSchool);
		}
		if (education.length() > 0) {
			resJson.put("education", education);
		}
		if (major.length() > 0) {
			resJson.put("major", major);
		}
		if (salaryCard.length() > 0) {
			resJson.put("salaryCard", salaryCard);
		}
		if (openingBank != null && openingBank.length() > 0) {
			resJson.put("openingBank", openingBank);
		}
		if (shebaoNum.length() > 0) {
			resJson.put("shebaoNum", shebaoNum);
		}
		if (emergencyContact.length() > 0) {
			resJson.put("emergencyContact", emergencyContact);
		}
		if (contactRelation.length() > 0) {
			resJson.put("contactRelation", contactRelation);
		}
		if (contactPhone.length() > 0) {
			resJson.put("contactPhone", contactPhone);
		}
		if (staffStatus > 0) {
			resJson.put("staffStatus", staffStatus);
		}
		if (positiveTime != null) {
			resJson.put("positiveTime", positiveTime.getTime()/1000);
		}
		if (leaveOfficeTime != null) {
			resJson.put("leaveOfficeTime", leaveOfficeTime.getTime()/1000);
		}
		if (hobbies != null && hobbies.length() > 0) {
			resJson.put("hobbies", hobbies);
		}
		if (preCompany != null && preCompany.length() > 0) {
			resJson.put("preCompany", preCompany);
		}
		if (sipServerIP != null && sipServerIP.length() > 0) {
			resJson.put("sipServerIP", sipServerIP);
		}
		if (incomingServerIP != null && incomingServerIP.length() > 0) {
			resJson.put("incomingServerIP", incomingServerIP);
		}
		if (entryFile != null && entryFile.length() > 0) {
			resJson.put("entryFile", entryFile);
		}
		if (pictureFile != null && pictureFile.length() > 0) {
			resJson.put("pictureFile", pictureFile);
		}
		if (identityFile != null && identityFile.length() > 0) {
			resJson.put("identityFile", identityFile);
		}
		if (bankFile != null && bankFile.length() > 0) {
			resJson.put("bankFile", bankFile);
		}
		if (otherFile != null && otherFile.length() > 0) {
			resJson.put("otherFile", otherFile);
		}
		if (entryFileUrl != null && entryFileUrl.length() > 0) {
			resJson.put("entryFileUrl", entryFileUrl);
		}
		if (pictureFileUrl != null && pictureFileUrl.length() > 0) {
			resJson.put("pictureFileUrl", pictureFileUrl);
		}
		if (identityFileUrl != null && identityFileUrl.length() > 0) {
			resJson.put("identityFileUrl", identityFileUrl);
		}
		if (bankFileUrl != null && bankFileUrl.length() > 0) {
			resJson.put("bankFileUrl", bankFileUrl);
		}
		if (otherFileUrl != null && otherFileUrl.length() > 0) {
			resJson.put("otherFileUrl", otherFileUrl);
		}
		if (memo != null && memo.length() > 0) {
			resJson.put("memo", memo);
		}
		if (referrer != null && referrer.length() > 0) {
			resJson.put("referrer", referrer);
		}
		if (groupMgr != null && groupMgr.length() > 0) {
			resJson.put("groupMgr", groupMgr);
		}
		if (shortNum != null && shortNum.length() > 0) {
			resJson.put("shortNum", shortNum);
		}
		
		return resJson;
	}
	
	public void parseFromJson(JSONObject resJson) {
		if (resJson.containsKey("ID")) {
			id = resJson.getIntValue("ID");
		} else if (resJson.containsKey("userID") ) {
			id = resJson.getIntValue("userID");
		}
		if (resJson.containsKey("CompanyID")) {
			companyID = resJson.getIntValue("CompanyID");
		}
		if (resJson.containsKey("position")) {
			position = resJson.getIntValue("position");
		}
		if (resJson.containsKey("leader")) {
			leaderID = resJson.getIntValue("leader");
		}
		if (resJson.containsKey("LoginName")) {
			loginName = resJson.getString("LoginName");
		}
		if (resJson.containsKey("UserName")) {
			userName = resJson.getString("UserName");
		}
		if (resJson.containsKey("mobiphone")) {
			mobiphone = resJson.getString("mobiphone");
		}
		if (resJson.containsKey("QQ")) {
			QQ = resJson.getString("QQ");
		}
		if (resJson.containsKey("weixin")) {
			weixin = resJson.getString("weixin");
		}
		if (resJson.containsKey("staffID")) {
			staffID = resJson.getString("staffID");
		}
		if (resJson.containsKey("teamID")) {
			teamID = resJson.getIntValue("teamID");
		}
		if (resJson.containsKey("sex")) {
			sex = resJson.getIntValue("sex");
		}
		if (resJson.containsKey("basicSalary")) {
			basicSalary = resJson.getIntValue("basicSalary");
		}
		if (resJson.containsKey("staffStatus")) {
			staffStatus = resJson.getIntValue("staffStatus");
		}		
		if (resJson.containsKey("identity")) {
			identity = resJson.getString("identity");
		}
		if (resJson.containsKey("nativePlace")) {
			nativePlace = resJson.getString("nativePlace");
		}
		if (resJson.containsKey("household")) {
			household = resJson.getString("household");
		}
		if (resJson.containsKey("entryTime")) {
			long tm = resJson.getLongValue("entryTime");
			tm = tm * 1000;
			entryTime = new Timestamp(tm);
		}
		if (resJson.containsKey("houseAddress")) {
			houseAddress = resJson.getString("houseAddress");
		}
		if (resJson.containsKey("graduateSchool")) {
			graduateSchool = resJson.getString("graduateSchool");
		}
		if (resJson.containsKey("education")) {
			education = resJson.getString("education");
		}
		if (resJson.containsKey("major")) {
			major = resJson.getString("major");
		}
		if (resJson.containsKey("salaryCard")) {
			salaryCard = resJson.getString("salaryCard");
		}
		if (resJson.containsKey("openingBank")) {
			openingBank = resJson.getString("openingBank");
		}
		if (resJson.containsKey("shebaoNum")) {
			shebaoNum = resJson.getString("shebaoNum");
		}
		if (resJson.containsKey("emergencyContact")) {
			emergencyContact = resJson.getString("emergencyContact");
		}
		if (resJson.containsKey("contactRelation")) {
			contactRelation = resJson.getString("contactRelation");
		}
		if (resJson.containsKey("contactPhone")) {
			contactPhone = resJson.getString("contactPhone");
		}
		if (resJson.containsKey("positiveTime")) {
			long tm = resJson.getLongValue("positiveTime");
			tm = tm * 1000;
			positiveTime = new Timestamp(tm);
		}
		if (resJson.containsKey("leaveOfficeTime")) {
			long tm = resJson.getLongValue("leaveOfficeTime");
			tm = tm * 1000;
			leaveOfficeTime = new Timestamp(tm);
		}
		if (resJson.containsKey("hobbies")) {
			this.hobbies = resJson.getString("hobbies");
		}
		if (resJson.containsKey("preCompany")) {
			this.preCompany = resJson.getString("preCompany");
		}
		if (resJson.containsKey("memo")) {
			this.memo = resJson.getString("memo");
		}
		if (resJson.containsKey("referrer")) {
			this.referrer = resJson.getString("referrer");
		}
		if (resJson.containsKey("groupMgr")) {
			this.groupMgr = resJson.getString("groupMgr");
		}
		if (resJson.containsKey("shortNum")) {
			this.shortNum = resJson.getString("shortNum");
		}
	}
	
	// 是否是 总部的
	public boolean isTopCompany() {
		CompanyModel company = CompanyDb.getCompanyByID(companyID);
		if (company != null && (company.getSuperCompanyID() == 0) ) {
			return true;
		}
		
		return false;
	}
	
	public int getBelongCompanyID() {
		int belongComID = companyID;
		CompanyModel company = CompanyCached.selectCompanyByID(companyID);
		if (company == null) {
			return companyID;
		}
		if (company != null && company.getCompanyAddr().length() > 0) {
			belongComID = companyID;
		}
		else {
			belongComID = company.getSuperCompanyID();
		}
		return belongComID;
	}
	
	public CompanyModel getBelongCompany() {
		CompanyModel company = CompanyDb.getCompanyByID(companyID);
		if (company == null) {
			return company;
		}
		if (company.getId() == company.getSuperCompanyID()) {
			return company;
		}
		if (company != null && company.getCompanyAddr().length() > 0) {
			return company;
		}
		else {
			company = CompanyDb.getCompanyByID(company.getSuperCompanyID());
		}
		return company;
	}
	
	public static int calcUserMOB(Timestamp tm) {
		if (tm == null) {
			return 0;
		}
		int curMonth = Calendar.getInstance().get(Calendar.MONTH);
		int curYear = Calendar.getInstance().get(Calendar.YEAR);
		Calendar c1 = Calendar.getInstance();
		c1.setTimeInMillis(tm.getTime());
		int year = c1.get(Calendar.YEAR);
		int mob = 0;
		if (year > 2010) {
			int m = c1.get(Calendar.MONTH);
			mob = (curYear-2010)*12 + curMonth - ((year-2010)*12 + m);			
		}
		
		return mob;
	}
	
	// 是否需要分配sip 账号
	public boolean needSipAccount() {
		if (position == ConstantDefine.Personnel || 
			position == ConstantDefine.Administration || 
			position == ConstantDefine.Financer ||  
			position == ConstantDefine.Customer_Service ) {
			return false;
		}
		
		return true;
	}
	
	// 是否需要分配群呼账号
	public boolean needIncomingSipAct() {
		if (this.position == ConstantDefine.Sales_Man || 
			this.position == ConstantDefine.Group_Leader || 
			this.position == ConstantDefine.Team_Manager ) {
			return true;
		}		
		
		return false;
	}
	
}
